Telegram Group & Telegram Channel
Приветствую фронты! Давно уже слышал про такую тему как <picture /> но применить на практике пришлось вот только недавно.

Задача: Отображать разные картинки в зависимости от размера девайса

Можно сделать и через CSS, но минус такого подхода в том что рендерится все-равно 2 картинки, а если элементов в которых нужно сделать такую подмену много(как у меня было) то это влияет на производительность. В итоге вспомнил про picture и применил его:

Выглядит примерно так:

<picture>
<source media="(min-width:650px)" srcset="big_pic.jpg">
<source media="(min-width:465px)" srcset="small_pic.jpg">
<img src="pic.jpg" alt="pic" style="width:auto;">
</picture>


В общем вот вам, экспериментируйте =)



tg-me.com/projavascript/77
Create:
Last Update:

Приветствую фронты! Давно уже слышал про такую тему как <picture /> но применить на практике пришлось вот только недавно.

Задача: Отображать разные картинки в зависимости от размера девайса

Можно сделать и через CSS, но минус такого подхода в том что рендерится все-равно 2 картинки, а если элементов в которых нужно сделать такую подмену много(как у меня было) то это влияет на производительность. В итоге вспомнил про picture и применил его:

Выглядит примерно так:

<picture>
<source media="(min-width:650px)" srcset="big_pic.jpg">
<source media="(min-width:465px)" srcset="small_pic.jpg">
<img src="pic.jpg" alt="pic" style="width:auto;">
</picture>


В общем вот вам, экспериментируйте =)

BY Javascript Pro


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/projavascript/77

View MORE
Open in Telegram


Javascript Pro Telegram | DID YOU KNOW?

Date: |

What is Telegram Possible Future Strategies?

Cryptoassets enthusiasts use this application for their trade activities, and they may make donations for this cause.If somehow Telegram do run out of money to sustain themselves they will probably introduce some features that will not hinder the rudimentary principle of Telegram but provide users with enhanced and enriched experience. This could be similar to features where characters can be customized in a game which directly do not affect the in-game strategies but add to the experience.

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Javascript Pro from ca


Telegram Javascript Pro
FROM USA